import yaml

res = []


def ergodic(conf, m=None):
    for key, value in conf.items():
        if isinstance(value, dict):
            m += str(key) + "."
            ergodic(value, m)
        else:
            m += str(key)
            res.append((m, value))


with open("sample.yaml", 'r') as f:
    config = yaml.load(f, yaml.FullLoader)
    ergodic(config, "")

print(res)
